package org.dolphin.base.bean;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.springframework.util.ObjectUtils;

public class ProductVO implements Serializable {
  private static final long serialVersionUID = 3508777043578695482L;
  private String id;
  private Long version;
  private String name;
  private BigDecimal baseRetailPrice;
  private List<ProductCategoryVO> categories = new ArrayList<ProductCategoryVO>(3);
  private List<ProductAttributeVO> attributes = new ArrayList<ProductAttributeVO>(3);

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    } else if (obj instanceof ProductVO) {
      ProductVO oth = (ProductVO) obj;
      return ObjectUtils.nullSafeEquals(getId(), oth.getId());
    }
    return false;
  }

  public List<ProductAttributeVO> getAttributes() {
    return attributes;
  }

  public BigDecimal getBaseRetailPrice() {
    return baseRetailPrice;
  }

  public List<ProductCategoryVO> getCategories() {
    return categories;
  }

  public String getId() {
    return id;
  }

  public String getName() {
    return name;
  }

  public Long getVersion() {
    return version;
  }

  @Override
  public int hashCode() {
    int hash = ObjectUtils.nullSafeHashCode(getId());
    return hash;
  }

  public void setAttributes(List<ProductAttributeVO> attributes) {
    this.attributes = attributes;
  }

  public void setBaseRetailPrice(BigDecimal baseRetailPrice) {
    this.baseRetailPrice = baseRetailPrice;
  }

  public void setCategories(List<ProductCategoryVO> categories) {
    this.categories = categories;
  }

  public void setId(String id) {
    this.id = id;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setVersion(Long version) {
    this.version = version;
  }
}
